C C -C Programming -C Programming /OOPS Concepts Sample Test,Sample questions

Question:
 
Which of the following provides a reuse mechanism?

1.Abstraction

2.Inheritance

3.Dynamic binding

4.Encapsulation


Question:
 
Which of the following statement is correct?

1.Class is an instance of object.

2. Object is an instance of a class.

3.Class is an instance of data type.

4.Object is an instance of data type.


Question:
  
How many types of polymorphisms are supported by C++?

1.1

2.2

3.3

4.4


Question:
  
In which of the following a virtual call is resolved at the time of compilation?

1.From inside the destructor.

2.From inside the constructor.

3.From inside the main().

4.Both A and B.


Question:
  
Which of the following concepts means waiting until runtime to determine which function to call?

1.Data hiding

2.Dynamic casting

3. Dynamic binding

4.Dynamic loading


Question:
  
Which of the following factors supports the statement that reusability is a desirable feature of a language?

1. It decreases the testing time.

2.It lowers the maintenance cost.

3.It reduces the compilation time.

4.Both A and B.


Question:
  
Which of the following is an abstract data type?

1.int

2.double

3.string

4.Class


Question:
  
Which of the following is an invalid visibility label while inheriting a class?

1.public

2.private

3.protected

4.friend


Question:
  
Which of the following is correct about the statements given below?

All operators can be overloaded in C++.
We can change the basic meaning of an operator in C++.

1.Only I is true.

2.Both I and II are false.

3.Only II is true.

4.Both I and II are true.


Question:
  
Which of the following is not a type of inheritance?

1.Multiple

2.Multilevel

3.Distributive

4.Hierarchical


Question:
  
Which of the following is the correct way of declaring a function as constant?

1. const int ShowData(void) { /* statements */ }

2. int const ShowData(void) { /* statements */ }

3. int ShowData(void) const { /* statements */ }

4. Both A and B


Question:
cout is a/an __________ .

1.operator

2.function

3.object

4.macro


Question:
How "Late binding" is implemented in C++?

1.Using C++ tables

2.Using Virtual tables

3.Using Indexed virtual tables

4.Using polymorphic tables


Question:
How many instances of an abstract class can be created?

1.1

2.5

3.13

4.0


Question:
Which of the following type of class allows only one object of it to be created?

1.Virtual class

2.Abstract class

3.Singleton class

4.Friend class


Question:
What happens if the base and derived class contains definition of a function with same prototype?

1. Compiler reports an error on compilation.

2.Only base class function will get called irrespective of object.

3.Only derived class function will get called irrespective of object.

4.Base class object will call base class function and derived class object will call derived class function.


Question:
What is correct about the static data member of a class?

1.A static member function can access only static data members of a class.

2.. A static data member is shared among all the object of the class.

3.A static data member can be accessed directly from main().

4.Both A and B.


Question:
Which inheritance type is used in the class given below?
class A : public X, public Y
{}

1. Multilevel inheritance

2.Multiple inheritance

3.Hybrid inheritance

4.Hierarchical Inheritance


Question:
Which of the following access specifier is used as a default in a class definition?

1.protected

2.public

3.private

4.friend


Question:
Which of the following approach is adapted by C++?

1.Top-down

2.Bottom-up

3.Right-left

4. Left-right


Question:
Which of the following are available only in the class hierarchy chain?

1. Public data members

2.Private data members

3.Protected data members

4.Member functions


Question:
Which of the following cannot be friend?

1.Function

2.Class

3.Object

4.Operator function


Question:
Which of the following cannot be used with the keyword virtual?

1.class

2. member functions

3.constructor

4.destructor


Question:
Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?

1.Call by value

2.Call by reference

3.Default arguments

4.Call by pointer


Question:
Which of the following concepts is used to implement late binding?

1.Virtual function

2. Operator function

3.Const function

4. Static function


Question:
Which of the following concepts means adding new components to a program as it runs?

1. Data hiding

2.Dynamic typing

3.Dynamic binding

4.Dynamic loading


Question:
Which of the following concepts means determining at runtime what method to invoke?

1.Data hiding

2.Dynamic Typing

3.Dynamic binding

4.Dynamic loading


Question:
Which of the following concepts means wrapping up of data and functions together?

1.Abstraction

2.Encapsulation

3.Inheritance

4.Polymorphism


Question:
Which of the following concepts of OOPS means exposing only necessary information to client?

1.Encapsulation

2.Abstraction

3.Data hiding

4.Data binding


Question:
Which of the following concepts provides facility of using object of one class inside another class?

1.Encapsulation

2.Abstraction

3.Composition

4.Inheritance


Question:
Which of the following correctly describes overloading of functions?

1.Virtual polymorphism

2.Transient polymorphism

3.Ad-hoc polymorphism

4.Pseudo polymorphism


Question:
Which of the following functions are performed by a constructor?

1.Construct a new class

2.Construct a new object

3.Construct a new function

4.Initialize objects


Question:
Which of the following header file includes definition of cin and cout?

1.istream.h

2.ostream.h

3.iomanip.h

4.iostream.h


Question:
Which of the following is a mechanism of static polymorphism?

1.Operator overloading

2.Function overloading

3.Templates

4.All of the above


Question:
Which of the following is correct about class and structure? 

1.class can have member functions while structure cannot.

2. class data members are public by default while that of structure are private.

3. Pointer to structure or classes cannot be declared.

4.class data members are private by default while that of structure are public by default.


Question:
Which of the following is correct about function overloading?

1.The types of arguments are different.

2.The order of argument is different.

3.The number of argument is same.

4. Both A and B.


Question:
Which of the following is not a type of constructor?

1.Copy constructor

2.Friend constructor

3.Default constructor

4. Parameterized constructor


Question:
Which of the following is not the member of class?

1.Static function

2.Friend function

3.Const function

4.Virtual function


Question:
Which of the following is the correct class of the object cout?

1.iostream

2.istream

3.ostream

4.ifstream


Question:
Which of the following is used to make an abstract class?

1.Declaring it abstract using static keyword.

2. Declaring it abstract using virtual keyword.

3.Making at least one member function as virtual function.

4.Making at least one member function as pure virtual function.


Question:
Which of the following keyword is used to overload an operator?

1.overload

2.operator

3.friend

4.override


Question:
Which of the following operator is overloaded for object cout?

1.>>

2.<<

3.+

4.=


Question:
Which of the following operators cannot be overloaded?

1.[]

2. ->

3.?:

4.*


Question:
Which of the following problem causes an exception?

1. Missing semicolon in statement in main().

2.A problem in calling function.

3.A syntax error.

4.A run-time error.


Question:
Which of the following statement is correct?

1.A constructor is called at the time of declaration of an object.

2.A constructor is called at the time of use of an object.

3.A constructor is called at the time of declaration of a class.

4. A constructor is called at the time of use of a class.


Question:
Which of the following statement is correct?

1.C++ allows static type checking.

2. C++ allows dynamic type checking.

3.C++ allows static member function be of type const.

4. Both A and B.


Question:
Which of the following statements is correct in C++?

1. Classes cannot have data as protected members.

2.Structures can have functions as members.

3.Class members are public by default.

4.Structure members are private by default.


Question:
Which of the following statements is correct?

1.Base class pointer cannot point to derived class.

2.Derived class pointer cannot point to base class.

3.Pointer to derived class cannot be created.

4. Pointer to base class cannot be created.


Question:
Which of the following statements regarding inline functions is correct

1.It speeds up execution

2.It slows down execution.

3.It increases the code size.

4.Both A and C.


Question:
Which of the following term is used for a function defined inside a class?

1. Member Variable

2.Member function

3.Class function

4.Classic function


Question:
Which of the following ways are legal to access a class data member using this pointer?

1.this->x

2.this.x

3.*this.x

4.*this-x


Question:
Which one of the following is correct about the statements given below?

All function calls are resolved at compile-time in Procedure Oriented Programming.
All function calls are resolved at compile-time in OOPS.

1.Only II is correct.

2.Both I and II are correct.

3.Only I is correct.

4.Both I and II are incorrect


Question:
Which one of the following is the correct way to declare a pure virtual function?

1.virtual void Display(void){0};

2.virtual void Display = 0;

3.virtual void Display(void) = 0;

4. void Display(void) = 0;


Question:
Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.

1.Inheritance

2.Polymorphism

3.Abstraction

4.Encapsulation


Question:
Which one of the following options is correct?

1.Friend function can access public data members of the class.

2.Friend function can access protected data members of the class.

3. Friend function can access private data members of the class.

4.All of the above.


Question:
Why reference is not same as a pointer?

1.A reference can never be null.

2.A reference once established cannot be changed.

3.Reference doesn,t need an explicit dereferencing mechanism.

4.All of the above.


More MCQS

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
  24. C MCQS:-The ABC of C
  25. C MCQS Interview Questions
  26. C++ Questions and Answers OOPs Basic Concepts
  27. C++ Questions and Answers Returning Objects
  28. C Programming MCQ Part 1
  29. C Programming MCQ
  30. Computer Science & Engineering C Multiple Choice Questions set 1
  31. Computer Science & Engineering C Multiple Choice Questions set 2
  32. C Multiple Choice Questions C Functions Set 1
  33. C Multiple Choice Questions C Functions Set 2
  34. C Multiple Choice Questions C Operators
  35. C Multiple Choice Questions & AnswersConditional Expressions
  36. C Multiple Choice Questions & Answers Data Types
  37. C Multiple Choice Questions & Answers File Access
  38. Computer Science & Engineering Cloud Computing MCQs Part 1
  39. CPP Programming MCQ Set 1
  40. CPP Programming MCQ Set 2
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!